﻿using System;
using System.Globalization;

namespace ApiScanner.Core
{
    internal sealed class MailboxServer
    {
        public MailboxServer(string name, string serialNumberString, string distinguishedName, string networkAddress)
        {
            Name = name;
            SerialNumberString = serialNumberString;
            DistinguishedName = distinguishedName;
            NetworkAddress = networkAddress;

            var serialNumberParts = SerialNumberString.Split(' ');
            SerialNumber = (float)Decimal.Parse(serialNumberParts[1], CultureInfo.InvariantCulture);
        }

        public string Name { get; private set;}
        public string SerialNumberString { get; private set; }
        public float SerialNumber { get; private set; }
        public string DistinguishedName { get; private set; }
        public string NetworkAddress { get; private set; }
        public bool RequiresSsl { get; set; }
    }
}